import Taro from '@tarojs/taro'
import { View } from "@tarojs/components";
import React, { Component } from "react";
import { AtMessage, AtTabBar } from "taro-ui";

class FooterCommon extends Component{

  state = {
    current: 0
  }

  handleClick (value) {
    this.setState({
      current: value
    })
    this.props.onFooterChange(value)
  }

  render () {
    return (
      <View>
        <AtMessage />
        <AtTabBar
          tabList={[
            { title: '出行', iconType: 'map-pin', text: 'new' },
            { title: '商城', iconType: 'shopping-cart' },
            { title: '个人中心', iconType: 'user', text: 'new' }
          ]}
          onClick={this.handleClick.bind(this)}
          current={this.state.current}
        />
      </View>
    )
  }
}

export default FooterCommon